package com.violet.excel.controller;

import com.violet.excel.condition.ExportCondition;
import com.violet.excel.service.ExcelService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/excel")
public abstract class ExcelController {

    @Resource
    private ExcelService excelService;

    @PostMapping("/export")
    public void exportFile(ExportCondition condition, HttpServletResponse response) {
        excelService.exportFile(condition, response);
    }

    @PostMapping("/import")
    public void importFile(HttpServletResponse response) {
        excelService.importFile();
    }

}